package com.uwlaser.service.dto;

import com.uwlaser.domain.BaseParam;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import java.util.List;

/**
 * 出站上传参数 - 单个
 */
@Data
public class OutboundParam extends BaseParam {

    @ApiModelProperty("产品序号")
    @NotBlank(message = "产品序号【productSn】不能为空！")
    private String productSn;

    @ApiModelProperty("出站结果")
    @NotBlank(message = "出站结果【result】不能为空！")
    private String result;

    @ApiModelProperty("是否出站")
    @NotBlank(message = "是否出站【isOutBound】不能为空！")
    private String isOutBound;

    @ApiModelProperty("缺陷代码")
    private String flawCode;

    @ApiModelProperty("托盘号")
    private String trayCode;

    @ApiModelProperty("通道号")
    private String aisleCode;


    @ApiModelProperty("过程参数列表")
    @Valid
    private List<Param>  params;

    @ApiModelProperty("物料列表")
    @Valid
    private List<Material>  materials;

    @Data
    public class Param {

        @ApiModelProperty("参数编码")
        @NotBlank(message = "参数编码【params.paramCode】不能为空！")
        private String paramCode;

        @ApiModelProperty("参数名称")
        @NotBlank(message = "参数名称【params.paramName】不能为空！")
        private String paramName;

        @ApiModelProperty("参数值")
        @NotBlank(message = "参数值【params.paramValue】不能为空！")
        private String paramValue;

        @ApiModelProperty("参数结果")
        @NotBlank(message = "参数结果【params.paramResult】不能为空！")
        private String paramResult;

        @ApiModelProperty("参数判断范围")
        @NotBlank(message = "参数判断范围【params.paramRange】不能为空！")
        private String paramRange;

        @ApiModelProperty("参数单位")
        @NotBlank(message = "参数单位【params.paramUnit】不能为空！")
        private String paramUnit;

        @ApiModelProperty("测试顺序")
        @NotBlank(message = "测试顺序【params.paramNumber】不能为空！")
        private String paramNumber;
    }



    @Data
    public class Material {

        @ApiModelProperty("物料序号")
        @NotBlank(message = "物料序号【materials.materialSn】不能为空！")
        private String materialSn;

        @ApiModelProperty("物料名称")
        @NotBlank(message = "物料名称【materials.materialName】不能为空！")
        private String materialName;

        @ApiModelProperty("物料编码")
        @NotBlank(message = "物料编码【materials.materialCode】不能为空！")
        private String materialCode;

        @ApiModelProperty("扫码顺序")
        @NotBlank(message = "扫码顺序【materials.scanNumber】不能为空！")
        private String scanNumber;
    }

}
